package com.lieve.bpm;

import com.lieve.bpm.entity.UserBean;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
//import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author sunlijiang
 * @date 2020/5/1
 */
//@SpringBootTest
public class StartFlow2 {

    @Resource
    private RepositoryService repositoryService;

    @Resource
    private RuntimeService runtimeService;

    @Resource
    private

    // @Test
    void contextLoads() {
        String deploymentId = repositoryService
                .createDeployment()
                .addClasspathResource("processes/taskJuel.bpmn20.xml")
                .deploy()
                .getId();
        System.out.println("deploymentId " + deploymentId);

        Map<String, Object> variableMap = new HashMap<>();
        variableMap.put("a", "sunlijiang");
        runtimeService.startProcessInstanceByKey("juel", variableMap);
        System.out.println("Hello");
        // userBean.hello();
    }

}
